<?php
/**
 * Created by PhpStorm.
 * User: 徐州
 * Date: 2017/5/4
 * Time: 10:44
 */

namespace App\Models\VoteGroup;

class VoteGroupService
{
    private $voteGroupRepository;

    public function __construct(\App\Contracts\Repositories\VoteGroup\VoteGroupRepository $voteGroupRepository)
    {
        $this->voteGroupRepository = $voteGroupRepository;
    }

    /**
     * 获取所有投票活动
     * @return array
     */
    public function getAll()
    {
        return [];
    }
    public function getItemById($id)
    {
        return $this->voteGroupRepository->findById($id)->toArray();
    }

    public function getItemByActivityId($activityId)
    {
        return $this->voteGroupRepository->findByActivityId($activityId);
    }
}
